//
//  UIWindow+KSScreen.m
//  BasketBallLeagues
//
//  Created by kenshin on 4/23/17.
//  Copyright © 2017 kenshin. All rights reserved.
//

#import "UIWindow+KSScreen.h"

@implementation UIWindow (KSScreen)

+ (CGFloat)ks_scale
{
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
        return 1.f;
    }
    return [self ks_screenWidth] / 320.f; //按320的标注缩放
}

+ (CGFloat)ks_screenWidth
{
    return CGRectGetWidth([UIScreen mainScreen].bounds);
}

+ (CGFloat)ks_screenHeight
{
    return CGRectGetHeight([UIScreen mainScreen].bounds);
}

+ (NSInteger)ks_scaledSize:(CGFloat)size
{
    return (NSInteger)([self ks_scale] * size);
}

@end
